const {
	http
} = uni.$u

// 订单列表
const orderList = (data) => {
	return http.get(`admin/order?page=${data.page}&perPage=${data.perPage}&order_sn=${data.order_sn}`)
}

// 订单详情
const orderDeatils = (id) => {
	return http.get(`admin/order/${id}`)
}
// 仓库列表
const warehouseList = (data) => {
	return http.get(`admin/warehouse?type=` + data)
}
// 客户列表/admin/member
const memberList = (data) => {
	return http.get(`admin/member`)
}
/**
 * 订单：仓库商品规格（商品列表）get
 * 逻辑：先选择仓库，再调用接口
 * admin/goods/warehouse/goods
 * warehouse_id
 */
const specification = (warehouse_id) => {
	return http.get(`admin/goods/warehouse/goods?warehouse_id=` + warehouse_id)
}
/**
 * 获取收货地址get
 * 逻辑：先选择客户，再调用接口
 * admin/member/get/address
 * user_id
 */
const addresslist = (user_id) => {
	return http.get(`admin/member/get/address?user_id=` + user_id)
}
// 创建订单
const addcreate = (data) => {
	return http.post(`/admin/order/create`, data)
}
// 出库
const outIndent = (id) => {
	return http.post(`/admin/order/out/${id}`)
}
// 根据自提码获取订单
const orderByCode = (self_code) => {
	return http.get(`admin/order/code/order?self_code=${self_code}`)
}

export {
	orderList,
	orderDeatils,
	warehouseList,
	memberList,
	specification,
	addresslist,
	addcreate,
	outIndent,
	orderByCode
}